package com.hulizuofang.wol.chat.client.ui.event.setlogin;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HasHandlers;

public class SetLoginEvent extends GwtEvent<SetLoginHandler> {
	private static final Type<SetLoginHandler> TYPE = new Type<SetLoginHandler>();
	private final String login;

	SetLoginEvent(String login) {
		this.login = login;
	}
	
	public String getLogin() {
		return login;
	}

	public static void fire(final HasHandlers source, String login) {
		source.fireEvent(new SetLoginEvent(login));
	}

	public static Type<SetLoginHandler> getType() {
		return TYPE;
	}
	@Override
	public Type<SetLoginHandler> getAssociatedType() {
		return getType();
	}

	@Override
	protected void dispatch(SetLoginHandler handler) {
		handler.onSetLogin(this);
	}

}
